package org.styx.seata.tcc.order.rest;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.styx.common.response.R;
import org.styx.common.response.ResultCode;
import org.styx.seata.tcc.order.domain.Order;
import org.styx.seata.tcc.order.service.OrderService;

/**
 * @date 2021/8/9
 * @auther uranus
 */
@RestController
@RequestMapping("/order")
@RequiredArgsConstructor
public class OrderRest {
    private final OrderService orderService;

    /**
     * 创建订单
     */
    @PostMapping("/create")
    public R create(Order order){
        orderService.create(order);
        return R.success(ResultCode.SUCCESS,"订单创建成功");
    }
}
